package canvas;

import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: ilya
 * Date: 16.10.11
 * Time: 14:05
 */
public class TranslatedCanvas implements Canvas {

    private int dx;
    private int dy;
    private Canvas canvas;

    public TranslatedCanvas(int dx, int dy, Canvas canvas) {
        this.dx = dx;
        this.dy = dy;
        this.canvas = canvas;
    }

    public void setColor(Color color) {
        canvas.setColor(color);
    }

    public void drawLine(int x1, int y1, int x2, int y2) {
        canvas.drawLine(dx + x1, dy + y1, dx + x2, dy + y2);
    }

    public void drawCircle(int x, int y, int r) {
        canvas.drawCircle(dx + x, dy + y, r);
    }
}
